<template>
  <div class="full-loading">
    <div class="loading-content">
      <img :src="loading" class="loading" alt="loading">
      <div class="text">{{ text }}</div>
    </div>
  </div>
</template>

<script>
import loading from "@/assets/images/gif/fullLodingGif.gif";
export default {
  props: {
    text: {
      type: String,
      default: "加载中...",
    },
  },
  data() {
    return {
      loading,
    };
  },
};
</script>

<style lang="scss" scoped>
.full-loading {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100vw;
  height: 100vh;
  background-color: rgba(65, 67, 71, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  .loading-content {
    padding: 16px;
    background-color: #fff;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    .text {
      color: black;
      font-size: 16px;
      margin-top: 12px;
    }
    .loading {
      width: 170px;
      height: 142px;
      animation: spin 1.2s linear infinite; /* 使用动画 */
    }
  }
}
</style>